define(function(require, exports, module) {
	var from = require('from'),
		to = require('to'),
		cont = require('cont'),
		upCase = require('fmtStr').upCase;

	function build(obj, callback) {
		var buildSender = function(objArr) {
			var html = '';

			for (var key in objArr) {
				if (objArr.hasOwnProperty(key)) {
					if (key !== 'name') {
						html += '<li>' + upCase(key) + '：' + (objArr[key] || '--') + '</li>';
					}			
				}
			}

			return html;
		};

		var html = 
			'<h4 class="title">' + upCase(cont.title) + '</h4>' +
			'<p>Dear ' + to.join(', ') + ',' + '</p>' +
			'<p class="cont">' + cont.content + '</p>' +
			'<ul class="sender">' +
				'<li><strong>' + from.name + '</strong></li>';

		html += buildSender(from) +
			'</ul>';

		obj.html(html);

		if (callback && typeof callback === 'function') {
			callback(obj);
		}
	}
	
	module.exports = build;
});